<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>图片滚动</title>
		<style type="text/css">
			#container{
				width: 100%;
				height: 600px;
				display: flex;
				justify-content: center;
				align-items: center;
			}
			#outdiv{
				width: 900px;
				height: 500px;
				display: flex;
				align-items: center;
				overflow: hidden;
			}
			#imgdiv{
				display: flex;
				width: 2400px;
				height: 150px;
			}
			#imgdiv img{
				width: 150px;
				height: 150px;
			}
		</style>
	</head>
	<body>
		<div id="container">
			<div id="outdiv">
				<div id="imgdiv">
					<img src="img/1.jpg" >
					<img src="img/2.jpg" >
					<img src="img/3.jpg" >
					<img src="img/4.jpg" >
					<img src="img/5.jpg" >
					<img src="img/6.jpg" >
					<img src="img/7.jpg" >
					<img src="img/8.jpg" >
					<img src="img/9.jpg" >
					<img src="img/10.jpg">
					<img src="img/1.jpg" >
					<img src="img/2.jpg" >
					<img src="img/3.jpg" >
					<img src="img/4.jpg" >
					<img src="img/5.jpg" >
					<img src="img/6.jpg" >
				</div>
			</div>
		</div>
	</body>
	<script type="text/javascript">
		var imgIdObj = document.getElementById('imgdiv');
		var left = 0;
		onload = function(){
			setInterval(function(){
				left--;
				imgIdObj.style.marginLeft = left + 'px';
				if(left == -1500){
					left = 0;
				}
			},5);
		}
	</script>
</html>
